home *** CD-ROM | disk | FTP | other *** search
/ Professional Soft Collection 1.02 / Professional Soft Collection 1.02.iso / qemm.80c / technote.qip / TESTPRGS.TEC < prev    next >
Text File  |  1995-11-04  |  12KB  |  266 lines

  1.  
  2.              Quarterdeck Advanced EMS Utilities
  3.  
  4.  Quarterdeck Technical Note #293             Filename: TESTPRGS.TEC
  5.  by Quarterdeck Documentation              CompuServe: TSTPRG.TEC
  6.  Last Revised: 04/05/95                      Category: QEMM
  7.  
  8.  Subject: A discussion of the advanced EMS utilities that ship with
  9.           QEMM.
  10.  
  11.  
  12.  EMS Utility Programs
  13.  --------------------
  14.  
  15.  This technical note describes three advanced EMS utility programs
  16.  that can give you more control over EMS memory. This document is
  17.  provided for programmers and advanced users who want to control
  18.  EMS memory allocation.
  19.  
  20.  QEMM includes three advanced utility programs: EMS.SYS, which give
  21.  you behind-the-scenes access to QEMM's management of EMS memory;
  22.  and EMS2EXT, which lets you allocate extended memory on the fly
  23.  through the pre-XMS INT 15 interface. You may never need these
  24.  programs, but they can prove useful in cases where you need more
  25.  control of memory allocation than your programs give you.
  26.  
  27.  
  28.  The EMS Programs
  29.  ----------------
  30.  
  31.  The EMS.COM and EMS.SYS programs provide several informative and
  32.  powerful functions to help you make the best use of your EMS
  33.  memory in cases in which you have special or unusual requirements.
  34.  Although anyone may benefit from seeing the EMS status report and
  35.  the details of expanded memory allocation, other uses of EMS which
  36.  will be described in these sections are for technically
  37.  sophisticated users.
  38.  
  39.  Most of the functions of EMS.SYS and EMS.COM involve the
  40.  manipulation of expanded memory handles. An EMS handle is the
  41.  information that the expanded memory manager uses to identify a
  42.  block of memory that it allocates. A handle is represented by a
  43.  number and may optionally have a name.
  44.  
  45.  An expanded memory handle is the token of interaction between an
  46.  EMS-using program and an expanded memory manager. EMS.SYS and
  47.  EMS.COM give you command-line control of some of the EMS functions
  48.  that are usually available only at the programming level. Since
  49.  these EMS utilities are capable of granting you access to handles
  50.  which may belong to other programs, you should exercise caution
  51.  when using these utilities.
  52.  
  53.  With the EMS programs, you can allocate and name a block of memory
  54.  with the CREATE option, and optionally specify that this block of
  55.  memory consists of the fastest or slowest memory on your system.
  56.  You can use the FREE option to free the expanded memory associated
  57.  with a handle. You can read data from a file into expanded memory
  58.  or write the data from expanded memory to a file with the LOAD or
  59.  SAVE options. You can rename an EMS handle and change the amount
  60.  of memory associated with it.
  61.  
  62.  The most common reason for using the EMS programs is to prevent a
  63.  specific application from using all of the memory in your system.
  64.  By issuing an EMS CREATE command before running an application,
  65.  you effectively "hide" the specified amount of memory from that
  66.  application. Many programs (e.g., Microsoft Windows, AutoCAD,
  67.  Quattro, Lotus 1-2-3 version 3) allocate a great deal of available
  68.  memory to themselves at startup time■sometimes as much as you have
  69.  on your system. By creating an EMS handle in the following
  70.  fashion:
  71.  
  72.    EMS CREATE handle_name 2048K
  73.  
  74.  you reserve 2 megabytes of memory, identified by the name
  75.  HANDLE_NAME, that other programs will see as already assigned, and
  76.  therefore will not touch. Once your program has started, you could
  77.  go to the DOS prompt and issue the command:
  78.  
  79.    EMS FREE handle_name
  80.  
  81.  to release the 2 megabytes of memory, which would leave 2
  82.  megabytes available after your application is running. Because
  83.  QEMM gives out both expanded and extended memory from the same
  84.  memory pool, you can use this method to withhold memory from
  85.  programs that allocate their memory through EMS, XMS, VCPI, or
  86.  DPMI. This method is particularly useful for preventing Microsoft
  87.  Windows 3.1 standard mode from allocating all memory, so that you
  88.  can run programs that get their memory through EMS, VCPI, or DPMI
  89.  inside Windows.
  90.  
  91.  If parts of the expanded memory in your system run at different
  92.  speeds, you can use EMS to allocate memory of one speed before you
  93.  load a device driver or TSR so that it can only use the faster or
  94.  slower memory that remains; then you can free the memory for use
  95.  by your other applications. Manifest can show you if your memory
  96.  runs at different speeds.
  97.  
  98.  If you are a programmer using expanded memory, you can use the
  99.  LOAD and SAVE functions when you need to save and restore the
  100.  contents of expanded memory during development and debugging. You
  101.  use EMS.SYS in the CONFIG.SYS file to manipulate expanded memory
  102.  during the system boot sequence. You use EMS.COM in the
  103.  AUTOEXEC.BAT file or directly from the DOS prompt, as needed.
  104.  
  105.  To get a summary report of your expanded memory:
  106.  
  107.  At the DOS prompt, type EMS and press Enter.
  108.  
  109.  EMS will report the total amount of expanded memory, the amount
  110.  currently available and the address of the page frame.
  111.  
  112.  EMS Parameters
  113.  
  114.  Both EMS.SYS and EMS.COM respond to the same parameters. The
  115.  parameters are described below. Some parameters have an
  116.  abbreviation you can use instead of the full name; abbreviations
  117.  are listed in parentheses below. Brackets ([ ]) in a statement
  118.  indicate that the enclosed item is optional.
  119.  
  120.  CREATE name amount (CR)
  121.  allocates expanded memory. CREATE requires two arguments: a name
  122.  for the block of memory you are allocating and the amount of
  123.  memory. The name may be one to eight characters long. The name
  124.  need not be enclosed in quotation marks unless it contains blanks.
  125.  You can express the amount of memory to allocate several ways: Use
  126.  a number by itself to express the amount of memory in EMS pages
  127.  (16K per page). Use a number directly followed by the letter K
  128.  (e.g., 2048K) to express the amount in kilobytes. If you specify
  129.  the number of kilobytes, the memory manager will round the number
  130.  up if necessary to a multiple of 16. You can use the letter M
  131.  instead of K to express a value in megabytes. You can use the
  132.  argument ALL to allocate all available memory. You can use the
  133.  argument ALL-nnnnnn, ALL-nnnnnnK or ALL-nnnM to allocate all
  134.  available memory minus a specified number of EMS pages, kilobytes
  135.  or megabytes.
  136.  
  137.  Follow the EMS CREATE command with the EMS DIR command to confirm
  138.  the allocation and to determine the handle number assigned to the
  139.  name.
  140.  
  141.  CREATEFAST name amount (CFAST)
  142.  and
  143.  CREATESLOW name amount (CSLOW)
  144.  are alternate forms of the CREATE option (see above) that instruct
  145.  the memory manager to allocate the memory from either faster or
  146.  slower memory. Use Manifest's Expanded Memory Timings to determine
  147.  if any speed difference does in fact exist.
  148.  
  149.  DIR
  150.  displays a breakdown of the current expanded memory allocated. For
  151.  each allocated handle, DIR gives the number of expanded memory
  152.  pages associated with it, the number of kilobytes of memory those
  153.  pages represent, and the name assigned to that handle, if any.
  154.  
  155.  FREE name or number
  156.  frees memory and deallocates a handle. FREE requires that you
  157.  specify a handle to deallocate, either by its name or number.
  158.  Beware of doing this to someone else's handle.
  159.  
  160.  HELP
  161.  displays help on the EMS programs and their options.
  162.  
  163.  LOAD name or number filename
  164.  allows you to restore the contents of expanded memory pages that
  165.  have been stored in a file. This option requires that you specify
  166.  the handle name (or number) and the name of the file containing
  167.  the data you want to restore. The number of pages required will be
  168.  automatically allocated based on the file's size.
  169.  
  170.  RENAME name or number new_name (REN)
  171.  lets you assign a new name to a handle. The first parameter to
  172.  RENAME is the original handle. You may refer to this handle by its
  173.  number or its name. The second argument is the new handle name.
  174.  RENAME can be useful to name an unnamed handle to help you keep
  175.  track of it.
  176.  
  177.  RESIZE name or number amount (RES)
  178.  lets you increase or decrease the amount of memory assigned to a
  179.  handle. Its two arguments are the same as those of CREATE (see
  180.  above).
  181.  
  182.  SAVE name or number filename
  183.  allows you to save the contents of the expanded memory pages
  184.  associated with an EMS handle to a file. This option requires that
  185.  you specify the handle name (or number) and the filename.
  186.  
  187.  ?
  188.  
  189.  lists the EMS programs' parameters.
  190.  
  191.  
  192.  EMS2EXT.SYS
  193.  -----------
  194.  
  195.  EMS2EXT.SYS converts expanded memory to extended memory, for
  196.  programs that rely upon the old INT 15 method of accessing
  197.  extended memory. This method is no longer widely used, and has
  198.  been replaced by XMS (the Extended Memory Specification). Older
  199.  versions of DOS shipped with utilities which relied upon the old
  200.  INT 15 interface, most notably VDISK.SYS. These drivers have since
  201.  been replaced by programs that use XMS instead, and as a result
  202.  EMS2EXT is rarely useful.
  203.  
  204.  EMS2EXT is not needed for programs that access memory through XMS,
  205.  VCPI, or DPMI. It is intended only to provide on-the-fly control
  206.  over extended memory allocated through the older INT 15 interface.
  207.  Programs which support XMS, VCPI or DPMI can allocate and
  208.  deallocate memory directly from QEMM's memory pool and have no
  209.  need for EMS2EXT.
  210.  
  211.  Even if you have an old extended memory utility, you cannot use
  212.  EMS2EXT if your program expects to access extended memory directly
  213.  at physical addresses above 1024K. Quarterdeck's QEXT.SYS driver,
  214.  supplied with DESQview, cannot use memory supplied by EMS2EXT.
  215.  Likewise, Microsoft's HIMEM.SYS cannot use memory supplied by
  216.  EMS2EXT.
  217.  
  218.  If you do have an old extended memory program that uses the INT 15
  219.  interface, EMS2EXT lets you allocate memory for that program out
  220.  of QEMM's memory pool. The advantage of allocating this memory
  221.  with EMS2EXT instead of with QEMM parameters is that the memory
  222.  allocation can later be increased or decreased with the EMS.COM
  223.  program without rebooting your system.
  224.  
  225.  EMS2EXT is a device driver and therefore needs to be loaded with a
  226.  DEVICE= statement in your CONFIG.SYS file. The statement to load
  227.  EMS2EXT should look like this:
  228.  
  229.    DEVICE=C:\QEMM\EMS2EXT.SYS MEMORY=nnn speed
  230.  
  231.  The nnn parameter in MEMORY=nnn is the number of kilobytes of
  232.  expanded memory to allocate initially (e.g., MEMORY=512). EMS2EXT
  233.  will allocate an EMS handle named EMS2EXT for a block of memory
  234.  nnnK in size. You can also load EMS2EXT without specifying any
  235.  MEMORY parameter. EMS2EXT will be resident, but it will not
  236.  allocate any memory. It will, however, reserve for itself a handle
  237.  with the name EMS2EXT.
  238.  
  239.  The optional SPEED parameter tells EMS2EXT to allocate faster or
  240.  slower memory if there are different speeds of memory on your
  241.  system. You may specify FAST, SLOW or no SPEED option at all. You
  242.  can, as needed, grow, or shrink the amount of extended memory for
  243.  the EMS2EXT handle using EMS.COM. You can use this capability to
  244.  give a program INT 15 extended memory only while it is running.
  245.  For instance, if you loaded EMS2EXT with no MEMORY parameter, you
  246.  could make a batch file which included the line:
  247.  
  248.    EMS RESIZE EMS2EXT 128K
  249.  
  250.  before running an application that needs 128K of extended memory
  251.  through the old INT 15 interface. When the program terminates,
  252.  another EMS statement could free the memory:
  253.  
  254.    EMS RESIZE EMS2EXT 0
  255.  
  256.  The memory is then returned to QEMM's memory pool for the use of
  257.  other programs.
  258.  
  259.  ******************************************************************
  260.  *      Trademarks are property of their respective owners.       *
  261.  *   This and other technical notes may be available in updated   *
  262.  *     forms through Quarterdeck's standard support channels.     *
  263.  *          Copyright (C) 1995 Quarterdeck Corporation            *
  264.  ******************** E N D   O F   F I L E ***********************
  265.  
  266.